import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import React,{lazy} from 'react' 

import {Routersx} from '../type/type';
const Home=lazy(()=>import('../pages/Home/Home'))
const Login=lazy(()=>import('../pages/Login/Login'))
// const Exhibition=lazy(()=>import('../pages/3Dexhibition/exhibition'))
const Error=lazy(()=>import('../pages/Error/Error'))
const Exhibition3D=lazy(()=>import('../pages/3D/index'))
export const Routerslist:Routersx[] = ([
    {
        path: '/',
        element: <Home/>,
        title: '首页',
    },
    {
        path: '/login',
        element: <Login />,
        title: '登录',
    },
    {
        path: '/Exhibition',
        element: <Exhibition3D />,
        title: '3D画廊',
    },
    {
        path: '*',
        element: <Error/>,
        title: '404'
    }
])

const routerdata=createBrowserRouter(Routerslist);
const Router=()=>{
    return (
        <RouterProvider router={routerdata}></RouterProvider>
        
    );
}

export default Router;